home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
SpinEvent.h,v
< prev
next >
Wrap
Text File
|
1989-02-23
|
2KB
|
161 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @ * @;
3.2
date 89.02.20.15.37.36; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.50.19; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.10.30.13.06.07; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.28.22.13.44; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#ifndef SpinEvent_h
#define SpinEvent_h
//
// Implement a UNIX event
//
#include "SpinLock.h"
const int EventMaxTimesAround = 1000;
class SpinEvent : public SpinLock {
short generation;
short pLoops;
short state;
short garcon; // waiters
public:
SpinEvent( int pLoops = EventMaxTimesAround );
~SpinEvent();
void rendezvous();
void waitFor();
void trigger();
void waiting();
int size();
};
inline
SpinEvent::SpinEvent( int l )
{
pLoops = l;
state = 1;
garcon = 0;
}
inline
SpinEvent::~SpinEvent()
{
}
void
SpinEvent::trigger()
{
reserve();
garcon = 0;
generation++;
release();
}
int
SpinEvent::size()
{
reserve();
int was = garcon;
release();
return(was);
}
#endif
@
3.1
log
@Steay version
@
text
@@
1.2
log
@*** empty log message ***
@
text
@d58 4
a61 5
//
// No point in reserving this -- unless they've reserved the thing,
// you can't insure that the value they get makes sense anyway.
//
return(garcon);
@
1.1
log
@Initial revision
@
text
@d1 8
a8 2
#ifndef HardEvent_h
#define HardEvent_h
d14 1
a14 1
#include "HardSpinLock.h"
d18 1
a18 1
class HardEvent : public HardSpinLock {
d24 2
a25 2
HardEvent( int pLoops = EventMaxTimesAround );
~HardEvent();
d34 1
a34 1
HardEvent::HardEvent( int l )
d42 1
a42 1
HardEvent::~HardEvent()
d47 1
a47 1
HardEvent::trigger()
d56 1
a56 1
HardEvent::size()
@